// pages/dy_details/dy_details.js
Page({
  data: {
    index: '',
    data: ''
  },
  onShow() {
    wx.setNavigationBarTitle({
      title: '阅读'
    })
  },
  onLoad(options) {
    this.setData({
      index: options.index
    })
    let that = this;
    wx.request({
      url: 'https://www.easy-mock.com/mock/5a9654e43d01940a2cdf9980/wechat/news',
      data: '',
      header: {},
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: function (res) {
        console.log(res.data[that.data.index])
        that.setData({
          data: res.data[that.data.index]
        })
      }
    })
  }
})